/*
 * GerenciarComponenteAction.java
 *
 * Created on 12 de Agosto de 2007, 13:10
 */

package tcc.gui.web.struts.componente;

import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import tcc.applicationService.Componente.ComponenteAS;
import tcc.domain.produto.Componente;

/**
 *
 * @author Administrador
 * @version
 */

public class GerenciarComponenteAction extends Action {

    /** Creates a new instance of GerenciarComponenteAction */
    public GerenciarComponenteAction() {
    }

    @Override
    public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {

        GerenciarComponenteForm formulario = (GerenciarComponenteForm) form;
        List<Componente> l = ComponenteAS.getIsntance().findAll();
        formulario.setListaComponentes(l);

        return mapping.findForward("erro");
    }
}
